package com.rmi.hello;

import java.rmi.Naming;

/**
 * Created by buguniao on 15/12/8.
 */
public class RMIClient {
    public static void main(String[] args) {
        String url = "rmi://localhost:5590/HelloRemote";
        try {
            HelloRemote helloRemote = (HelloRemote) Naming.lookup(url);
            com.rmi.hello.User user = new com.rmi.hello.User();
            user.setName("我的名字叫牛逼");
            helloRemote.sayHello(user);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
